package com.example.android.plugin.framework.beans;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 插件功能，也就相当于插件提供的类
 */
public class PluginFeatureBean {
	private String featureName; // 类名

	private List<PluginFeatureMethod> methods; // 方法集合

	private Map<String, String> fields; // 属性集合

	public Map<String, String> getFields() {
		return fields;
	}

	public void setFields(Map<String, String> fields) {
		this.fields = fields;
	}

	public void setMethods(List<PluginFeatureMethod> methods) {
		this.methods = methods;
	}

	/**
	 * 插件类
	 */
	public PluginFeatureBean() {
		methods = new ArrayList<PluginFeatureMethod>();
		fields = new HashMap<String, String>();
	}

	/**
	 * 获得功能名(类名)
	 * 
	 * @return
	 */
	public String getFeatureName() {
		return featureName;
	}

	/**
	 * 设置功能名(类名)
	 * 
	 * @param featureName
	 */
	public void setFeatureName(String featureName) {
		this.featureName = featureName;
	}

	/**
	 * 获得方法列表
	 * 
	 * @return
	 */
	public List<PluginFeatureMethod> getMethods() {
		return methods;
	}

	/**
	 * 设置方法列表
	 * 
	 * @param methods
	 */
	public void addMethod(PluginFeatureMethod method) {
		methods.add(method);
	}

	public void addField(String name, String type) {
		fields.put(name, type);
	}

}
